import shapelib

sh = shapelib.open('/home/furyy/data/Eesti Geograafia/EGCD/eestikaardid/asulad.shp', 'rb')
ent = sh.info()[0]
types = sh.info()[1]
min = sh.info()[2]
max = sh.info()[3]
print sh.info()
print ent
for i in range(0, ent):
    verts = sh.read_object(i)
    print verts.type, len(verts.vertices()[0])
    ext = verts.extents()[0]
    print [(x[0] - ext[0], x[1]-ext[1],) for x in verts.vertices()[0]] 


sh.close()
